package shared.util;

import java.util.Random;

/**
 * This class represents a ThreadLocal store for Random objects.
 * Note, the returned random objects are NOT SecureRandom, but
 * plain randoms.
 * 
 * @author Vincent Tsuei
 * @version 2012-11-16
 */
public class Randomizer {
    
    private static final ThreadLocal<Random> store = new ThreadLocal<Random>() {
        @Override
        public Random initialValue() {
            return new Random();
        }
    };
    
    public static Random getRandom() {
        return store.get();
    }
}
